package com.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * @ClassName : com.demo.Application
 * @Description : 类描述
 * Created by cyd on 2021-11-10 15:40:15
 */
@SpringBootApplication
public class Application {

    private static ConfigurableApplicationContext context;

    public static void main(String[] args) {
        //运行启动类，第一个参数是本类的class，第二个参数是main方法的参数；
        context = SpringApplication.run(Application.class, args);

        System.out.println("--------------项目启动了---------------");
        ConfigurableEnvironment environment = context.getEnvironment();
        String port = environment.getProperty("server.port");
        String contextPath = environment.getProperty("server.servlet.context-path");
        System.out.println("http://localhost:" + port + contextPath + "/demo/helloWorld");
        System.out.println("http://localhost:" + port + contextPath + "/cpu/getMonitorInfoBean");
        System.out.println("http://localhost:" + port + contextPath + "/smartFireApiTest/api/v1/app/subscription/create");
        System.out.println("http://localhost:" + port + contextPath + "/smartFireApiTest/api/v1/app/subscription/delete");

    }
}
